#ifndef _USER_H
#define _USER_H
#include<iostream>
#include <QHostAddress>
#include<cstring>
#include<vector>
#include<QVector>
//#include "Global.h"
using namespace std;
//static int count=0;
class user
{
public:
    int count=0;
    user(QString id, QString name,QString password):
        id(id),name(name),password(password){}
    user(){}
    QString getUserName()
    {
        return this->name;
    };
    QString getUserId()
    {
        return this->id;
    };
    QString getUserGender()
    {
        return this->gender;
    }
    QString getUserGenderInChinese()
    {
        if (this->gender == "0")
            return "女";
        else if (this->gender == "1")
            return "男";
        else
            return "未知";
    }
    QString getUserPassword()
    {
        return this->password;
    }
    QString getUserPhoto()
    {
        return this->photo;
    }
    QString getUserQQ()
    {
        return this->qq;
    }
    QString getUserBirthday()
    {
        return this->birthDay;
    }
    QString getUserEmail()
    {
        return this->email;
    }
    void setUserName(QString name)
    {
        this->name=name;
    }
    void setUserPassword(QString password)
    {
        this->password=password;
    }
    void setUserId(QString id)
    {
        this->id=id;
    }
    void setUserGender(QString gender)
    {
        this->gender=gender;
    }
    void setUserEmail(QString email)
    {
        this->email=email;
    }
    void setUserBirthday(QString birthday)
    {
        this->birthDay=birthday;
    }
    void setUserQQ(QString qq)
    {
        this->qq=qq;
    }
    void setUserPhoto(QString photo)
    {
        this->photo=photo;
    }
    ~user()
    {
        //qDebug()<<"Destructing user";
    }
    friend class LogOnWidget;
    friend class MainInterfaceWidget;
    friend class addfriendreceiver;
    friend class addfriendsearch;
    friend class addfriendsender;
    friend class firendlist;
private:
    QString id;
    QString name;
    QString photo;
    QString qq;
    QString birthDay;
    QString password;
    QString email;
    QString gender;//性别 0为女，1为男, 2默认
    QString friendlist;//每个朋友只存储id 不同朋友用空格间隔
};

struct UserBrief
{
    QString id;
    QString username;
    QString photo;
    QString gender;

};

struct UserChange
{
    QString username;
    QString password;
    QString photo;
};

#endif
